# Contributor: Michał Polański <michal@polanski.me>
# Maintainer: Michał Polański <michal@polanski.me>
pkgname=py3-uvloop
pkgver=0.19.0
pkgrel=1
pkgdesc="Ultra fast asyncio event loop"
url="https://github.com/MagicStack/uvloop"
license="MIT OR Apache-2.0"
arch="all"
makedepends="py3-setuptools python3-dev py3-wheel cython libuv-dev"
checkdepends="py3-pytest py3-aiohttp py3-openssl py3-psutil"
subpackages="$pkgname-pyc"
source="https://github.com/MagicStack/uvloop/archive/v$pkgver/py3-uvloop-$pkgver.tar.gz
	skip-broken-ppc64le-test.patch
	tcp-tests.patch
	cython3.patch
	"
builddir="$srcdir/uvloop-$pkgver"

build() {
	python3 setup.py build build_ext --inplace --cython-always --use-system-libuv
}

check() {
	PYTHONASYNCIODEBUG=1 PYTHONPATH="$(echo "$builddir"/build/lib.linux-*)" pytest -v \
		-k 'not test_remote_shutdown_receives_trailing_data and not test_getaddrinfo_8 and not test_getaddrinfo_9'
}

package() {
	python3 setup.py install --root="$pkgdir" --skip-build
}

sha512sums="
aa6b81ee81951504bd37ab73cf8ae908e121dba7a2f9fb06a7c3d9e6f7db87656162dfb4bef3157d9bd245485096a0c999b97e50658955abbc201dfaec8930f6  py3-uvloop-0.19.0.tar.gz
3dea46539b1d146b5ada29af675ee32b9c0ef4655c6ca45544ad41dfd66e192ae51b55e9b61b4bdc9e640407aca40927e73078ddeb9b2b39b2966d7f29b7f1c3  skip-broken-ppc64le-test.patch
7149b80ba9fe0389531f6befe0570c0a1b11639a7d544e84378cc2cb3b107269b1bbcd211f09dc2824bdf1b0971714780bd80e0a19941d215b1f40807cfd44b0  tcp-tests.patch
8a7424658bea5e6240dc452911e999eae66651669fc10f1155dcdb334de5d184e3a2fe4b566d34dedc142fab38271eeb608405573fa34644d3b5d81b56bd4087  cython3.patch
"
